

<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<link type="text/css" rel="stylesheet" href="${createLinkTo(dir:'css/csslxh',file:'lxh.css')}">
	<title>Roleinfo List</title>
</head>

<script language="javascript">

function trim(str)
{
	return str.replace(/(^\s*)|(\s*$)/g, "");
}

function seleAll(ckBoxName, myChecked)
{
	names = document.getElementsByName(ckBoxName);
	for(var i = 0; i < names.length; i++)
	{
		names[i].checked = myChecked
	}
}

function getCheckboxValue(ckBoxName)
{
	var ckBoxValue = "";
	names = document.getElementsByName(ckBoxName);
	for(var i = 0; i < names.length; i++)
	{
		if(names[i].checked == true)
		{
			ckBoxValue += names[i].value+",";
		}
	}
	if(ckBoxValue != "")
		ckBoxValue = ckBoxValue.substring(0, ckBoxValue.length-1);
	return ckBoxValue;
}

function delBatch()
{
	var ckValues = "";
	ckValues = getCheckboxValue("myId");
	if(ckValues == "")
	{
		alert('请至少选择一项');
		return false;
	}
	var flag = confirm('真的要删除吗?');
	if(!flag) return false;
	document.location.href = "delBatch?batchIds="+ckValues;
	return false;
}

function doQuery()
{
	var nametj = trim(document.all.nametj.value);
	nametj = encodeURI(nametj);
	location.href = "list?nametj="+nametj;
}
</script>

<body style="margin:0; overflow:auto">

<table width="100%" height="23" border="0" cellpadding="0" cellspacing="0" background="../imagesmain/grayListBg.gif">
  <tr>
    <td width="2">&nbsp;</td>      
    <td width="50" align="center">
    	<g:link action="createRole" style="text-decoration:none;color:#000000">
    		<img src="${createLinkTo(dir:'imagesmain',file:'grayAdd.gif')}" border="0" style="margin-bottom:-1px; margin-right:3px"><g:message code="lxh.func.create"/>
    	</g:link>
    </td>
    <td width="5">&nbsp;</td>    
    <td width="70" align="center">
    	<a href="#" onclick="delBatch();return false;" style="text-decoration:none;color:#000000">
    		<img src="${createLinkTo(dir:'imagesmain',file:'grayDel.gif')}" border="0" style="margin-bottom:-1px; margin-right:3px"><g:message code="lxh.func.batchdel"/>
    	</a>
    </td>    
    <td width="15">&nbsp;</td>    
    <td width="80" background="../imagesmain/grayListNameBg.gif">
    	<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" style="border-left:solid 1px #c0c0c0;border-right:solid 1px #c0c0c0">
    		<tr>
    			<td align="center" style="padding-top:2px;padding-left:15px;padding-right:15px" nowrap>角色列表</td>
    		</tr>
    	</table>    
    </td>    
    <td>&nbsp;</td>    
	<td align=right width="250">
		<table width="100%" height="16" cellpadding="0" cellspacing="0">
			<tr>
			    <td align="right" style="padding-top:3px">角色名称&nbsp;</td>
				<td width="20" background="../imagesmain/appleTextLeft.gif">&nbsp;</td>
				<td width="110" valign="middle" background="../imagesmain/appleTextMiddle.gif">
					<input name="nametj" value="${nametj}" class="textApple" onkeypress="if(event.keyCode==13) doQuery();">
				</td>
				<td width="8" background="../imagesmain/appleTextRight.gif">&nbsp;</td>
			</tr>
		</table>
	</td>	
	<td width="10">&nbsp;</td>		
  </tr>  
</table>


<g:if test="${flash.message}">
	<div class="message">${flash.message}</div>
</g:if>


<table align="center" class="tableGray" cellpadding="0" cellspacing="1" style="margin-top:5px;">

    <td width="40" align="center" class="tableGrayHr" style="height:24px;padding-left:0px;"><input type="checkbox" name="seleAll" onclick="seleAll('myId', this.checked)"></td> 

    <td class="tableGrayHr" style="color:#000000">角色名称</td>
    
    <td class="tableGrayHr" style="color:#000000">备注</td>
         
	<td width="110px" align="center" class="tableGrayHr" style="color:#000000">操作</td>    
	    
    <g:each in="${roleinfoInstanceList}" status="i" var="roleinfoInstance">
    	<tr bgcolor="#ffffff" onmouseover="this.style.background='#FFF1D1'" onmouseout='this.style.background="#ffffff"'>
    		<td align="center" style="padding-left:0px"><input type="checkbox" name="myId" value="${roleinfoInstance.id}"></td> 
        
        	<td><g:link action="show" id="${roleinfoInstance.id}">${roleinfoInstance.rolename?.encodeAsHTML()}</g:link></td>
        	
        	<td>${roleinfoInstance.memo?.encodeAsHTML()}</td>
        
            <td align="center" style="color:#0F598C">
            	[<g:link action="edit" id="${ roleinfoInstance.id }">修改</g:link>]
                [<g:link action="delete" id="${ roleinfoInstance.id }" onclick="return confirm('真的要删除吗?');">删除</g:link>]
            </td>
        </tr>
	</g:each>

	                
</table>      


<table width="98%" align="center">
	<tr>
        <td align="right" style="height:30px; padding-right:2px;">
        	<g:paginate total="${totalRow}" params='[nametj:"${nametj}"]'/>
        </td>
	</tr> 
</table>

         
</body>
</html>
